package io.renren.controller;

import io.renren.common.utils.R;
import io.swagger.annotations.Api;
import javax.annotation.Resource;
import me.chanjar.weixin.common.api.WxConsts;
import me.chanjar.weixin.common.api.WxConsts.OAuth2Scope;
import me.chanjar.weixin.mp.api.WxMpService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author: lilanfeng
 * @Date: 2019/5/6 16:35
 * @Description:
 */

@RestController
@RequestMapping("/api")
@Api(tags="微信登陆接口")
public class WxLoginController {

  private WxMpService wxService;

  @Autowired
  public WxLoginController(WxMpService wxService) {
    this.wxService = wxService;
  }



  @RequestMapping("/getLoginUrl")
  private R getLoginUrl(){
    String url = "wwwwww";
    String s = wxService.oauth2buildAuthorizationUrl(url, OAuth2Scope.SNSAPI_USERINFO, null);
    return R.ok(s);

  }

}
